package cn.cau.service.impl;

import cn.cau.dao.AuditingTopInfoDao;
import cn.cau.dao.CodeRuleDao;
import cn.cau.entity.AuditingTopInfo;
import cn.cau.entity.AuditingUtils;
import cn.cau.entity.CodeRule;
import cn.cau.service.AuditingTopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AuditingTopServiceImpl implements AuditingTopService {
    @Autowired
    AuditingTopInfoDao auditingTopInfoDao;

    @Autowired
    CodeRuleDao codeRuleDao;

    @Override
    public int addInfo(AuditingTopInfo auditingTopInfo) {
        return auditingTopInfoDao.addInfo(auditingTopInfo);
    }

    @Override
    public List<AuditingTopInfo> getTopAuditingInfoByCodeId(int id){
        return auditingTopInfoDao.findTopInfoByCodeId(id);
    }

    @Override
    public List<CodeRule> getRuleByCateIdAndName(AuditingUtils utils) {
        return codeRuleDao.findCodeRuleByCategory(utils);
    }
}
